package com.qg.utils;


import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;

import javax.jms.Destination;

@Component
public class ActiveMqUtil {

    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;

    public void sendQueueMessage(String queue,final  Object message){
        Destination destination=new ActiveMQQueue(queue);
        jmsMessagingTemplate.convertAndSend(destination,message);
    }
}
